package com.turing.post.salesmanage.util;

import java.io.Serializable;
import java.math.BigInteger;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.IdClass;
import javax.persistence.Table;

/**
 * 燃气汽车卡管理信息
 * 
 * @author zxp
 * @Apr 9, 2013
 */
@SuppressWarnings("serial")
@Entity
@Table(name = "GasAutoManagement")
@IdClass(GasAutoManagement.class)
public class GasAutoManagement implements Serializable {

	private String cardNo;// 卡号 车主购卡时填写
	private BigInteger appId;// 应用管理ID
	private String VIN;// 车架号
	private String autoNumber;// 车牌号
	private String gasCylinderNo;// 气瓶编号
	private Integer gasCylinderNum;// 气瓶数量
	private String regNo;// 注册编号
	private String autoType;// 车辆种类
	private Date expiredDate;// 到检日期

	public GasAutoManagement() {

	}

	@Id
	@Column(name = "cardNo")
	public String getCardNo() {
		return cardNo;
	}

	public void setCardNo(String cardNo) {
		this.cardNo = cardNo;
	}

	@Id
	@Column(name = "appId")
	public BigInteger getAppId() {
		return appId;
	}

	public void setAppId(BigInteger appId) {
		this.appId = appId;
	}

	@Column(name = "VIN")
	public String getVIN() {
		return VIN;
	}

	public void setVIN(String vin) {
		VIN = vin;
	}

	@Column(name = "autoNumber")
	public String getAutoNumber() {
		return autoNumber;
	}

	public void setAutoNumber(String autoNumber) {
		this.autoNumber = autoNumber;
	}

	@Column(name = "gasCylinderNo")
	public String getGasCylinderNo() {
		return gasCylinderNo;
	}

	public void setGasCylinderNo(String gasCylinderNo) {
		this.gasCylinderNo = gasCylinderNo;
	}

	@Column(name = "gasCylinderNum")
	public Integer getGasCylinderNum() {
		return gasCylinderNum;
	}

	public void setGasCylinderNum(Integer gasCylinderNum) {
		this.gasCylinderNum = gasCylinderNum;
	}

	@Column(name = "regNo")
	public String getRegNo() {
		return regNo;
	}

	public void setRegNo(String regNo) {
		this.regNo = regNo;
	}

	@Column(name = "autoType")
	public String getAutoType() {
		return autoType;
	}

	public void setAutoType(String autoType) {
		this.autoType = autoType;
	}

	@Column(name = "expiredDate")
	public Date getExpiredDate() {
		return expiredDate;
	}

	public void setExpiredDate(Date expiredDate) {
		this.expiredDate = expiredDate;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result
				+ ((getAppId() == null) ? 0 : getAppId().hashCode());
		result = prime * result
				+ ((getCardNo() == null) ? 0 : getCardNo().hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		final GasAutoManagement other = (GasAutoManagement) obj;
		if (getAppId() == null) {
			if (other.getAppId() != null)
				return false;
		} else if (!getAppId().equals(other.getAppId()))
			return false;
		if (getCardNo() == null) {
			if (other.getCardNo() != null)
				return false;
		} else if (!getCardNo().equals(other.getCardNo()))
			return false;
		return true;
	}

}
